// routes/homeRoutes.js
import {
  getHomes,
  getHomeById,
  getCancel,
  concern,
  addData,
  deleteData,
  getAll,
  update,
} from "../controllers/concernController.js";
import Router from "koa-router";

const router = new Router({ prefix: "/api/concern" }); // 设置路由前缀

router.get("/count/:username", getHomes); // 获取所有主页记录
router.get("/:user", getHomeById); // 根据ID获取主页记录
router.get("/cancel/:user", getCancel); // 根据ID获取主页记录
router.post("/concern/:user", concern);
router.post("/isConcern/:user", concern);

router.post("/add/add", addData);
router.get("/delete/delete/:user", deleteData);
router.get("/all/all", getAll);
router.post("/update/update", update);

export default router;
